package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum SortStatus {
	
	MONEY(2),
	USERCOUNT(1),
	SUBSCRIBETIME(0);
	
	private Integer value;
	
	
	private SortStatus(Integer value){
		this.value = value;
	}

	public int toIntValue() {
		return this.value;
	}

	public static SortStatus toValue(int value) {
		if (MONEY.value == value) {
			return MONEY;
		} else if (USERCOUNT.value == value) {
			return USERCOUNT;
		}else if (SUBSCRIBETIME.value == value) {
			return SUBSCRIBETIME;
		} else {
			throw new InvalidArgumentException("Unknown is[" + value + "].");
		}
	}
}
